<#--分页-->
<#macro paging pageData>
    <div style="text-align: center">
        <div id="laypage-main"></div>
    </div>
    <script>
        layui.use('laypage', function () {
            var laypage = layui.laypage;
            laypage.render({
                elem: 'laypage-main',
                count: ${pageData.total},
                curr: ${pageData.current},
                limit: ${pageData.size},
                jump: function (obj, first) {
                    // 首页不执行
                    if (!first) {
                        location.href = "?pn=" + obj.curr;
                    }
                }
            })
        })
    </script>
</#macro>

<#--博客文章-->
<#macro postItem post>
    <li>
        <a href="${basePath}/user/${post.authorId}" class="fly-avatar">
            <img src="${post.authorAvatar}" alt="${post.authorName}">
        </a>
        <h2>
            <a class="layui-badge">${post.categoryName}</a>
            <a href="${basePath}/post/${post.id}">${post.title}</a>
        </h2>
        <div class="fly-list-info">
            <a href="${basePath}/user/${post.authorId}" link>
                <cite>${post.authorName}</cite>
                <i class="iconfont icon-renzheng" title=""></i>
                <i class="layui-badge fly-badge-vip">VIP ${post.authorVip}</i>
            </a>
            <span>${timeAgo(post.createTime)}</span>
            <span class="fly-list-nums">
                <i class="iconfont icon-pinglun1" title="评论"></i> ${post.commentCount}
            </span>
        </div>
        <div class="fly-list-badge">
            <#if post.level gt 0><span class="layui-badge layui-bg-black">置顶</span></#if>
            <#if post.recommend><span class="layui-badge layui-bg-red">精帖</span></#if>
        </div>
    </li>
</#macro>

<#--用户中心左侧菜单-->
<#macro centerLeft index>
    <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
        <li class="layui-nav-item <#if index == 0>layui-this</#if>">
            <a href="${basePath}/user/home">
                <i class="layui-icon">&#xe609;</i>我的主页
            </a>
        </li>
        <li class="layui-nav-item <#if index == 1>layui-this</#if>">
            <a href="${basePath}/user/index">
                <i class="layui-icon">&#xe612;</i>用户中心
            </a>
        </li>
        <li class="layui-nav-item <#if index == 2>layui-this</#if>">
            <a href="${basePath}/user/set">
                <i class="layui-icon">&#xe620;</i>基本设置
            </a>
        </li>
        <li class="layui-nav-item <#if index == 3>layui-this</#if>">
            <a href="${basePath}/user/message">
                <i class="layui-icon">&#xe611;</i>我的消息
            </a>
        </li>
    </ul>
</#macro>